package com.mybed.crm.controller;

import com.mybed.crm.pojo.dto.LoginDto;
import com.mybed.crm.result.LoginResult;
import com.mybed.crm.result.Result;
import com.mybed.crm.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private LoginService loginService;

    /**
     * 登入
     * @return
     */
    @PostMapping
    public LoginResult Login(@RequestBody LoginDto loginDto){
        LoginResult result=loginService.login(loginDto);
        return result;
    }
}
